﻿using Autofac;
using System.Reflection;
using Module = Autofac.Module;

namespace WMS.FC.Infrastructure.Register
{
    public class AutoFacModuleRegister : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            var assemblysDomain = Assembly.Load("WMS.FC.Domain");
            var assemblysInfrastructure = Assembly.Load("WMS.FC.Infrastructure");
            var assemblysApplication = Assembly.Load("WMS.FC.Application");
            builder.RegisterAssemblyTypes(assemblysDomain).InstancePerDependency().AsImplementedInterfaces();
            builder.RegisterAssemblyTypes(assemblysInfrastructure).InstancePerDependency().AsImplementedInterfaces();
            builder.RegisterAssemblyTypes(assemblysApplication).InstancePerDependency().AsImplementedInterfaces();
        }
    }
}
